<template>
  <div class="desktop">
    <!-- 保持桌面背景和图标 -->
    <div class="desktop-icons">
      <!-- ... 原有的桌面图标 ... -->
    </div>
    
    <!-- 游戏窗口容器 -->
    <div class="windows-container">
      <router-view v-slot="{ Component }">
        <transition name="window">
          <component :is="Component" />
        </transition>
      </router-view>
    </div>
    
    <!-- 任务栏 -->
    <div class="taskbar">
      <!-- ... -->
    </div>
  </div>
</template>

<script setup>
</script>

<style lang="scss">
@use '@/styles/variables' as *;

.desktop {
  height: 100vh;
  background: url('@/assets/wallpapers/default.jpg') center/cover;
  overflow: hidden;
  position: relative;
}

.windows-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 40px); // 减去任务栏高度
  pointer-events: none; // 允许点击穿透到桌面
  
  > * {
    pointer-events: auto; // 恢复窗口的点击事件
  }
}

// 窗口动画
.window-enter-active,
.window-leave-active {
  transition: all 0.3s ease;
}

.window-enter-from,
.window-leave-to {
  opacity: 0;
  transform: scale(0.9);
}
</style> 